package com.itheima.web.mapper.pms;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.vo.pms.PmsProductAttribute;
import com.itheima.vo.pms.PmsProductAttributeCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ProductAttributeCategoryMapper extends BaseMapper<PmsProductAttributeCategory> {

    @Select("select * from pms_product_attribute_category limit #{pageNum},#{pageSize}")
    List<PmsProductAttributeCategory> pageInfo2(@Param("pageNum") int pageNum,@Param("pageSize") int pageSize);

    List<PmsProductAttributeCategory> get();

    @Select("select * from pms_product_attribute where product_attribute_category_id=#{id}")
    List<PmsProductAttribute> getByCAId(Integer id);

    @Update("update pms_product_attribute_category set name=#{name} where id=#{id}")
    boolean updateBy(@Param("id") int id,@Param("name") String name);
}
